package cn.itzzx.lagou.mybatis.session;

import cn.itzzx.lagou.mybatis.pojo.Configuration;

/**
 * 生产 DefaultSqlSession 将 configuration 包装到该类中
 *
 * @author Martin
 * @date 2020-04-25
 * @see 1.0
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory{

    private Configuration configuration;

    public DefaultSqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(configuration);
    }
}
